import 'package:flutter/material.dart';
import 'package:happy_elf_app/utils/adaption.dart';
import 'package:happy_elf_app/utils/color.dart';

class goTogether extends StatefulWidget {
  const goTogether({super.key});

  @override
  State<goTogether> createState() => _goTogetherState();
}

class _goTogetherState extends State<goTogether>
    with SingleTickerProviderStateMixin {
  late AnimationController _controller;
  TextEditingController controller = TextEditingController();
  late FocusNode _focusNode;


  @override
  void initState() {
    super.initState();
    _focusNode = FocusNode();
    _controller = AnimationController(vsync: this);
  }

  @override
  void dispose() {
    _controller.dispose();
    _focusNode.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: Container(
        child: Column(
          children: [
            Container(
              decoration: BoxDecoration(
                color: hexColor('#ffffff'),
                boxShadow: const [
                  BoxShadow(
                    color: Color(0x14000000),
                    blurRadius: 8.21,
                    offset: Offset(4.11, 4.11),
                    spreadRadius: 0,
                  ),BoxShadow(
                    color: Color(0x14000000),
                    blurRadius: 8.21,
                    offset: Offset(-2.05, -2.05),
                    spreadRadius: 0,
                  )
                ]
              ),
              child: Image.asset('lib/assets/images/home/egg.png', width: 200)),
            SizedBox(height: 24),
            Container(
              child: Text('工作事业', style: TextStyle(fontSize: 18),),
            ),
            SizedBox(height: 24),
            Container(
              width: 280,
              height: 100,
              child: Focus(
                onFocusChange: (hasFocus) {
                  if(!hasFocus) {
                    // 完成输入
                  }
                },
                child: TextField(
                  controller: controller, // 输入内容
                  cursorColor: hexColor('#F04136'), // 光标颜色
                  cursorWidth: 2.px, // 光标粗细
                  focusNode: _focusNode,
                  decoration: InputDecoration(
                    filled: true,
                    fillColor: Colors.white,
                    contentPadding: EdgeInsets.only(bottom: 0, left: 8, top: 10),
                    counterText: "",
                    hintText: '写下你的招募宣言吧',
                    hintMaxLines: 1,
                    focusedBorder: OutlineInputBorder(
                        // 输入框输入时的样式
                        borderSide: BorderSide(
                          color: hexColor('#cccccc'),
                          width: 1.px,
                        ),
                        borderRadius: BorderRadius.circular(16)),
                    enabledBorder: OutlineInputBorder(
                      borderSide: BorderSide(
                        color: hexColor('#cccccc'), // 边框颜色
                        width: 1.px,
                      ),
                      borderRadius: BorderRadius.circular(16),
                    ),
                  ),
                  maxLines: 1,
                  style: const TextStyle(
                    fontSize: 14,
                    fontWeight: FontWeight.w400,
                  ),
                ),
              ),
            ),
            SizedBox(height: 10),
            GestureDetector(
              child: Container(
                alignment: Alignment.center,
                decoration: BoxDecoration(
                  color: hexColor('#e9614d'),
                  borderRadius: BorderRadius.circular(10)
                ),
                child: Text('发布招募', style: TextStyle(color: hexColor('#FFFFFF'))),
              ),
            )
          ],
        ),
      ),
    );
  }
}